<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> FAQ管理 </title>

<?php include VIEWS.'admin/style.html'?>

<script type="text/javascript">
<!--
function toggleClassNames() {
  var n = this.className;
  this.className = this.altClassName;
  this.altClassName = n;
}

function setupDatarows() {
  var v = document.getElementsByTagName("tr");
  for (var i = 0; i < v.length; i++) {
    if (v[i].className.indexOf("datarow") != -1) {
      v[i].onmouseover = toggleClassNames;
      v[i].onmouseout = toggleClassNames;
      v[i].altClassName = v[i].className + " hover";
    }
  }
}

window.onload = setupDatarows;
//-->
</script>

</head>

<body>
    
<?php include VIEWS.'admin/head.html'?>

<ul id="submenu">
    <li><a href='faqs.php' class="current">FAQ列表</a></li>
    <li><a href='faqsedit.php?add=1'>新增FAQ</a></li>
</ul>

<div id="body">

<br />
<div style="float:right"><form method="get"><input type="hidden" name="sort" value="<?php echo $sort?>"><input type="text" name="s" value="<?php echo $list['data']['search']?>"> <input type="submit" value="查询">&nbsp;<a href="faqs.php?sort=<?php echo $sort?>"><small>清除搜索</small></a></form></div>
</div>

<br clear="all" />

<?php if (count($list['list'])==0):?><table style="border: 1px solid #aa0000;" width="100%" border="0" align="left" bgcolor="#FFE5E5" cellpadding="4" cellspacing="0"> <tr> <td> <div class="errorheader">没有找到任何FAQ。</div> </td> </tr> </table><br /><br clear="all">

<?php else:?>

<table class="reportV2" cellpadding="5" width="98%" cellspacing="0">
<tr class="columntitle"><td><a href="faqs.php?sort=id&s=<?php echo $data['search']?>">ID</a></td><td width="50%" nowrap="" style="text-align:left"><a href="faqs.php?sort=q&s=<?php echo $data['search']?>">问题</a></td><td nowrap><a href="faqs.php?sort=views&s=<?php echo $data['search']?>">浏览数</a></td><td nowrap><a href="faqs.php?sort=updated&s=<?php echo $data['search']?>">更新日期</a></td><td nowrap>操作</td></tr>
<?php 
foreach ($list['list'] as $v):
$faqslist_i++;
?>
<tr class="<?php echo ($faqslist_i % 2 ==0) ? 'even' : 'odd'?> datarow">
<td><?php echo $v['id']?></td><td style="font-weight:bold;text-align:left"><?php echo $v['q']?></td><td><?php echo $v['views']?></td><td><small><?php echo date('y-m-d H:i', $v['updated'])?></small></td><td nowrap><a href="faqsedit.php?id=<?php echo $v['id']?>">修改</a> - <a href="javascript:cRedirect('faqsedit.php?id=<?php echo $v['id']?>&remove=1', '确定要删除ID为 “<?php echo $v['id']?>” FAQ 吗？')">删除</td></tr>
</tr>
<?php endforeach;?>
</table>
<?php include VIEWS.'admin/pages.html'?>
<?php endif;?>

<?php include VIEWS.'admin/runtime.html'?>

</div>

</body>
</html>
